package modules::dict;

use module;
use vars '@ISA';
@ISA = ("module");
use DBI;
use Net::Dict;
use encoding "utf8";
use utf8;

sub got_groupchat_bokarjoveoru {
my ($pkg,%args) = @_;
my (@words_di) = split(/ /,$args{body});
$dicteoru = Net::Dict->new('localhost');
utf8::encode($words_di[1]);
$eoru = $dicteoru->define("$words_di[1]", 'bokarjoveoru');
foreach $ild (@{$eoru}) {
        ($db, $def) = @{$ild};
utf8::decode($def);
main::SendMessage(to => $args{from}, type => $args{type}, body => "\nБаза $db:\n $def");
}
}

sub got_groupchat_bokarjovrueo {
my ($pkg,%args) = @_;
my (@words_di) = split(/ /,$args{body});
$dictrueo = Net::Dict->new('localhost');
utf8::encode($words_di[1]);
$rueo = $dictrueo->define("$words_di[1]", 'bokarjovrueo');
foreach $ild (@{$rueo}) {
        ($db, $def) = @{$ild};
utf8::decode($def);
main::SendMessage(to => $args{from}, type => $args{type}, body => "\nБаза $db:\n $def");
}
}

sub got_groupchat_revo {
my ($pkg,%args) = @_;
my (@words_di) = split(/ /,$args{body});
$dictrevo = Net::Dict->new('localhost');
utf8::encode($words_di[1]);
$dictrevo->setDicts('revo_eo', 'revo_cs', 'revo_de', 'revo_en', 'revo_es', 'revo_fr', 'revo_la', 'revo_ru', 'revo_tr');
$revo = $dictrevo->define("$words_di[1]");
foreach $ild (@{$revo}) {
        ($db, $def) = @{$ild};
utf8::decode($def);
main::SendMessage(to => $args{from}, type => $args{type}, body => "\nБаза $db:\n $def");
}
}

main::pd("................\n\n\n");
1;